<ion-view view-title="我的金网">
  <ion-nav-bar class="bar-energized light">
    <ion-nav-back-button>
    </ion-nav-back-button>
  </ion-nav-bar>
  <div class="bar bar-subheader" style="padding:0;height:2.875rem;" ng-if="!isLogin">
    <div class="jw-subheader {{employerState}}" ng-click="chooseEmployer()">我是雇主</div>
    <div class="jw-subheader {{employeeState}}" ng-click="chooseEmployee()">我是雇员</div>
  </div>
  <ion-content>
      <div ng-if="!isLogin" style="padding-top: 44px;">
      <div class="list card" ng-if="employerState" >
        <div><div class="jw-subheader {{loginOp}}" ng-click="employerLogin()">登入</div><div class="jw-subheader {{signOp}}" ng-click="employerSign()">注册</div></div>
          <div style="padding:5px;" ng-if="!loginOp">
            <form name="loginForm"  ng-submit="submitLoginForm('employer')">
              <label class="item item-icon-left">
                <i class="icon ion-android-phone-portrait"></i>
                <input type="text"
                       name="phone"
                       placeholder="手机号"
                       ng-model="userData.phone"
                       required
                       ng-pattern="/^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/"
                       >
                <span class="item-note jw-error" ng-if="signUpForm.phone.$error.required&&signUpForm.phone.$touched">
                  手机号不能为空
                </span>
                <span class="item-note jw-error" ng-if="signUpForm.phone.$invalid&&signUpForm.phone.$touched&&!signUpForm.phone.$error.required">
                  输入格式错误
                </span>
              </label>
              <label class="item item-icon-left">
                <i class="icon ion-ios-unlocked-outline"></i>
                <input type="password"
                       name="password"
                       placeholder="密码"
                       ng-model="userData.password">
                  <span class="item-note jw-error">
                  </span>
              </label>
              <a style="margin-left: 20px;margin-top: 10px;" href="#/tab/forget/1">忘记密码</a>
              <button class="button button-positive button-full" style="margin-top: 20px;">登入</button>
            </form>
          </div>
          <div style="padding:5px;" ng-if="loginOp">
            <form name="signUpForm" ng-submit="submitSignUpForm('employer')">
              <label class="item item-icon-left">
                <i class="icon ion-person"></i>
                <input type="text"
                       name="userName"
                       placeholder="姓名"
                       ng-model="userData.userName"
                       required
                       >
                <span class="item-note jw-error" ng-if="signUpForm.userName.$error.required&&signUpForm.userName.$touched">
                  名字不能为空
                </span>
              </label>
              <label class="item item-icon-left">
                <i class="icon ion-android-phone-portrait"></i>
                <input type="text"
                       name="phone"
                       placeholder="手机号"
                       ng-model="userData.phone"
                       required
                       ng-pattern="/^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/"
                       >
                <span class="item-note jw-error" ng-if="signUpForm.phone.$error.required&&signUpForm.phone.$touched">
                  号码不能为空
                </span>
                <span class="item-note jw-error" ng-if="signUpForm.phone.$invalid&&signUpForm.phone.$touched&&!signUpForm.phone.$error.required">
                  输入格式错误
                </span>
              </label>
              <div class="item item-icon-left item-button-right">
                <i class="icon ion-clock"></i>
                <input type="text"
                       name="yzm"
                       placeholder="验证码"
                       ng-model="userData.yzm"
                       >
                <button type="button" class="button button-clear" ng-click="getCode()">获取验证码</button>
              </div>
              <label class="item item-icon-left">
                <i class="icon ion-ios-unlocked-outline"></i>
                <input type="password"
                       name="password"
                       placeholder="密码"
                       ng-model="userData.password"
                       required
                       ng-minlength="6"
                       ng-maxlength="12"
                       >
                <span class="item-note jw-error" ng-if="signUpForm.password.$error.required&&signUpForm.password.$touched">
                  密码不能为空
                </span>
                <span class="item-note jw-error" ng-if="(signUpForm.password.$error.minlength||signUpForm.password.$error.maxlength)&&signUpForm.password.$touched">
                  密码6至12位之间
                </span>

              </label>
              <label class="item item-icon-left">
                <i class="icon ion-ios-unlocked-outline"></i>
                <input type="password"
                       name="password2"
                       placeholder="确认密码"
                       ng-model="userData.password2"
                       compare="userData.password"
                       >
                <span class="item-note jw-error" ng-if="signUpForm.password2.$error.compare&&signUpForm.password2.$touched">
                  两次密码不一致
                </span>
              </label>
              <label class="item item-checkbox">
                <label class="checkbox">
                  <input type="checkbox" ng-model="userData.seeappl" checked>
                </label>
                申请须知
              </label>
              <button class="button button-positive button-full" type="submit" style="margin-top: 20px;" ng-disabled="">注册</button>
            </form>
          </div>
      </div>

      <div class="list card" ng-if="!employerState" >
        <div><div class="jw-subheader {{loginOp}}" ng-click="employerLogin()">登入</div><div class="jw-subheader {{signOp}}" ng-click="employerSign()">注册</div></div>
        <div style="padding:5px;" ng-if="!loginOp">
          <form name="loginForm"  ng-submit="submitLoginForm('employee')">
            <label class="item item-icon-left">
              <i class="icon ion-android-phone-portrait"></i>
              <input type="text"
                     name="phone"
                     placeholder="手机号"
                     ng-model="userData.phone"
                     required
                     ng-pattern="/^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/"
              >
                <span class="item-note jw-error" ng-if="signUpForm.phone.$error.required&&signUpForm.phone.$touched">
                  手机号不能为空
                </span>
                <span class="item-note jw-error" ng-if="signUpForm.phone.$invalid&&signUpForm.phone.$touched&&!signUpForm.phone.$error.required">
                  输入格式错误
                </span>
            </label>
            <label class="item item-icon-left">
              <i class="icon ion-ios-unlocked-outline"></i>
              <input type="password"
                     name="password"
                     placeholder="密码"
                     ng-model="userData.password">
                  <span class="item-note jw-error">
                  </span>
            </label>
            <a style="margin-left: 20px;margin-top: 10px;" href="#/tab/forget/2">忘记密码</a>
            <button class="button button-positive button-full" style="margin-top: 20px;">登入</button>
          </form>
        </div>
        <div style="padding:5px;" ng-if="loginOp">
          <form name="signUpForm" ng-submit="submitSignUpForm('employee')">
            <label class="item item-input">
              <span class="input-label">姓名</span>
              <input type="text" ng-model="userData.name">
            </label>
            <label class="item item-input">
              <span class="input-label">身份证</span>
              <input type="text" ng-model="userData.idetifidy">
            </label>
            <label class="item item-input item-select">
              <div class="input-label">
                工作类型:
              </div>
              <select ng-model="userData.workType">
                <option ng-repeat="role in roleList">{{role.identity}}</option>
              </select>
            </label>
            <label class="item item-input">
              <span class="input-label">服务城市</span>
              <input type="text" ng-model="userData.city">
            </label>
            <label class="item item-input">
              <span class="input-label">手机号</span>
              <input type="text" ng-model="userData.phone">
            </label>

            <label class="item item-input">
              <span class="input-label">头像</span>
              <input type="file" id="touxiang" size="45" name="touxiang" >
            </label>

            <label class="item item-input">
              <span class="input-label">身份证正面照</span>
              <input type="file" ng-file-select="onFileSelect($files)" multiple accept="image/*" >
            </label>
            <label class="item item-input">
              <span class="input-label">身份证背面照</span>
              <input type="file" ng-file-select="onFileSelect($files)" multiple accept="image/*" >
            </label>
            <label class="item item-input">
              <span class="input-label">健康证照</span>
              <input type="file" ng-file-select="onFileSelect($files)" multiple accept="image/*" >
            </label>
            <label class="item item-input">
              <span class="input-label">技能证照</span>
              <input type="file" ng-file-select="onFileSelect($files)" multiple accept="image/*" >
            </label>
            <label class="item item-input item-button-right">
              <span class="input-label">验证码</span>
              <input type="text" ng-model="userData.yzm">
              <button class="button button-clear">获取验证码</button>
            </label>
            <label class="item item-input">
              <span class="input-label">密码</span>
              <input type="password" ng-model="userData.password">
            </label>
            <label class="item item-checkbox">
              <label class="checkbox">
                <input type="checkbox" ng-model="userData.applyknow">
              </label>
              申请须知
            </label>
            <label class="item item-checkbox">
              <label class="checkbox">
                <input type="checkbox" ng-model="userData.servertitle">
              </label>
              服务条款
            </label>
            <button class="button button-positive button-full" style="margin-top: 20px;">注册</button>
          </form>
        </div>
      </div>
      </div>
    <div class="list" ng-if="isLogin">
      <div ng-if="employerState">
        <a class="item item-avatar item-icon-right" href="#/tab/option">
          <img src="img/adam.jpg">
          <h2>{{userInfo.name}}</h2>
          <p>{{userInfo.phone}}</p>
          <i class="icon ion-chevron-right"></i>
        </a>
<!--
        <a class="item item-icon-left">
          <i class="icon ion-heart"></i>
          会员等级
        </a>
-->

        <a class="item item-icon-left" >
          <i class="icon ion-clipboard"></i>
          我的账号
        </a>
        <a class="item item-icon-left" >
          <i class="icon ion-clipboard"></i>
          服务历史
        </a>
        <a class="item item-icon-left" >
          <i class="icon ion-clipboard"></i>
          招聘信息发布
        </a>

        <a class="item item-icon-left" href="#">
          <i class="icon ion-card"></i>
          积分商城
        </a>
        <a class="item item-icon-left" href="#/tab/employer_info">
          <i class="icon ion-card"></i>
          基本信息
        </a>
        <a class="item item-icon-left" href="#/tab/employer_comment">
          <i class="icon ion-card"></i>
          我的评价
        </a>

        <a class="item item-icon-left" href="#">
          <i class="icon ion-card"></i>
          信息中心
        </a>
        <a class="item item-icon-left" href="#">
          <i class="icon ion-card"></i>
          我的推广
        </a>
        <a class="item item-icon-left" href="#/tab/edit_password">
          <i class="icon ion-settings"></i>
          修改密码
        </a>
        <a class="item item-icon-left" >
          <i class="icon ion-android-menu"></i>
          常见问题
        </a>
      </div>
      <div ng-if="!employerState">
        <a class="item item-avatar item-icon-right"   href="#/tab/option">
          <img src="img/adam.jpg">
          <h2>{{userInfo.name}}</h2>
          <p>{{userInfo.phone}}</p>
          <i class="icon ion-chevron-right"></i>
        </a>
        <a class="item item-icon-left" >
          <i class="icon ion-clipboard"></i>
          我的账号
        </a>
        <a class="item item-icon-left" >
          <i class="icon ion-clipboard"></i>
          服务历史
        </a>
        <a class="item item-icon-left" href="#/tab/employer_info">
          <i class="icon ion-card"></i>
          基本信息
        </a>

        <a class="item item-icon-left" href="#">
          <i class="icon ion-card"></i>
          订单提醒
        </a>
        <a class="item item-icon-left" href="#/tab/edit_password">
          <i class="icon ion-settings"></i>
          接单确认
        </a>
        <a class="item item-icon-left" >
          <i class="icon ion-android-menu"></i>
          上岗确认
        </a>
        <a class="item item-icon-left" >
          <i class="icon ion-android-menu"></i>
          状态修改
        </a>

        <a class="item item-icon-left" href="#">
          <i class="icon ion-card"></i>
          我的推广
        </a>

        <a class="item item-icon-left" >
          <i class="icon ion-android-menu"></i>
          常见问题
        </a>
      </div>
    </div>
    </div>
  </ion-content>

</ion-view>
